" echom "提示：This is plugins-vim-which-key.vimrc"

" -----------------------------------------------------------------------------
" 主题插件 liuchengxu/vim-which-key  配置

	" 使用
		" 按前缀键可打开弹窗提示相关快捷键提示
		" 基于已经存在的快捷键映射，直接使用一个字符串说明介绍信息即可
		" 不存在相关的快捷键映射，需要用一个 list：
		" :WhichKey! {'a':{'name':'b'}}  " 会打开一个面板，显示a -> b
	" 配置
		" if(isInstallPlug)
			" By default timeoutlen is 1000 ms
			" 默认超时是 1000 ms，如果不想那么长的话，你可以在 vimrc 中设置更短一些
			set timeoutlen=500
			" 注册键位与对应的 dict，这一步比较简单，不要忘记就行。
			"
			" 使用默认<Leader> 前缀键' \'
			
			" 配置使用默认的前缀键'\'唤起导航提示面板
			" Normal模式下\会调出菜单面板
			nnoremap <silent> <Leader> :<c-u>WhichKey '\'<CR>
			" visual模式下\会调出菜单面板
			vnoremap <silent> <Leader> :<c-u>WhichKey '\'<CR>
			call which_key#register('\', "g:which_key_map")
			
			" " 修改前缀键 为空格键
			" let g:mapleader = "\<Space>"
			" " Normal模式下\会调出菜单面板
			" nnoremap <silent> <Leader> :<c-u>WhichKey '<Space>'<CR>
			" " visual模式下\会调出菜单面板
			" vnoremap <silent> <Leader> :<c-u>WhichKey '<Space>'<CR>
			" call which_key#register('<Space>', "g:which_key_map")


			" let g:maplocalleader = ','   "只对某类文件 （如Python文件、HTML文件）而设置的映射。
			" nnoremap <silent> <localleader> :<c-u>WhichKey  ','<CR>

			" Define prefix dictionary
			let g:which_key_map =  {}
			" 注：配置的快捷键配置需要写在此行之后，才会被该插件识别加入到提示面板中
			
			" 引导菜单配置例子
				" let g:which_key_map.f = { 'name' : '+文件' }
				" nnoremap <silent> <Leader>fs :update<CR>
				" let g:which_key_map.f.s = '保存文件'
				"
				" nnoremap <silent> <leader>oq  :copen<CR>
				" nnoremap <silent> <leader>ol  :lopen<CR>
				" let g:which_key_map.o = {
				"       \ 'name' : '+open',
				"       \ 'q' : 'open-quickfix'    ,
				"       \ 'l' : 'open-locationlist',
				"       \ }
				"
				" let g:which_key_map['w'] = {
				"       \ 'name' : '+windows' ,
				"       \ 'w' : ['<C-W>w'     , 'other-window']          ,
				"       \ 'd' : ['<C-W>c'     , 'delete-window']         ,
				"       \ '-' : ['<C-W>s'     , 'split-window-below']    ,
				"       \ '|' : ['<C-W>v'     , 'split-window-right']    ,
				"       \ '2' : ['<C-W>v'     , 'layout-double-columns'] ,
				"       \ 'h' : ['<C-W>h'     , 'window-left']           ,
				"       \ 'j' : ['<C-W>j'     , 'window-below']          ,
				"       \ 'l' : ['<C-W>l'     , 'window-right']          ,
				"       \ 'k' : ['<C-W>k'     , 'window-up']             ,
				"       \ 'H' : ['<C-W>5<'    , 'expand-window-left']    ,
				"       \ 'J' : ['resize +5'  , 'expand-window-below']   ,
				"       \ 'L' : ['<C-W>5>'    , 'expand-window-right']   ,
				"       \ 'K' : ['resize -5'  , 'expand-window-up']      ,
				"       \ '=' : ['<C-W>='     , 'balance-window']        ,
				"       \ 's' : ['<C-W>s'     , 'split-window-below']    ,
				"       \ 'v' : ['<C-W>v'     , 'split-window-below']    ,
				"       \ '?' : ['Windows'    , 'fzf-window']            ,
				"       \ }
			" 快捷键帮助菜单 
				" let g:which_key_map.u = { 'name' : '+面板' }
				" let g:which_key_map.c = { 'name' : '+注释' }
			" 无跟随功能面板
				" 设置字典数值 
				" let HelpMenuDictionary = {
				"     \  ':NERDTreeToggle':{'name':'打开目录树'},
				"     \  'Alt+=':{'name':'显隐底部终端'},
				"     \  'Alt+q':{'name':'底部终端切换到命令模式'}
				"     \ }
				" 命令模式下输入:WhichKey! HelpMenuDictionary
			" 其他按键也弹提示
				nnoremap <silent> ] :<c-u>WhichKey ']'<CR>
				nnoremap <silent> [ :<c-u>WhichKey '['<CR>
				" nnoremap <silent> b :<c-u>WhichKey 'b'<CR>
				nnoremap <silent> m :<c-u>WhichKey 'm'<CR>

		" endif
	" 参考资料
		" + [Vim 插件: vim-which-key](https://www.jianshu.com/p/e47f7ec27cea)
